package com.itheima.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

/**
 * 循环依赖
 */
@Service
public class ServiceA {
    @Lazy  //解决循环依赖：方法二
    @Autowired
    private ServiceB serviceB;
    public void update(){
        serviceB.eat();
    }
    public void put(){
        System.out.println("Service A  put.................");
    }
}
